import request from '_c/utils/request'

// 查询产品政策配置列表
export function listData(query) {
    return request({
        url: '/api/ag/agent/open/policy/list',
        method: 'get',
        params: query
    })
}

export function listDataUnderAgent(query) {
    return request({
        url: '/api/ag/agent/open/policy/underAgent/list',
        method: 'get',
        params: query
    })
}

// 查询产品政策配置详细
export function getById(id) {
    return request({
        url: '/api/ag/agent/open/policy/' + id,
        method: 'get'
    })
}
export function policyInfo(query) {
    return request({
        url: '/api/ag/agent/open/policy/info',
        method: 'get',
        params: query
    })
}

// 一级代理开通产品查询政策配置内容
export function getPolicyConfig(data) {
    return request({
        url: '/api/ag/agent/open/policy/config',
        method: 'get',
        params:data
    })
}

// 查询可开通的产品政策列表
export function getCanOpenList(data) {
    return request({
        url: '/api/ag/agent/open/policy/can/open',
        method: 'get',
        params: data
    })
}



// 开通
export function open(data) {
    return request({
        url: '/api/ag/agent/open/policy/do',
        method: 'post',
        data
    })
}

// 修改
export function update(data) {
    return request({
        url: '/api/ag/agent/open/policy/edit',
        method: 'post',
        data
    })
}

// 修改代理商激活分账配置
export function activeShareEdit(data) {
    return request({
        url: '/api/ag/agent/open/policy/edit/active/share/config',
        method: 'post',
        data
    })
}
// 修改代理商结算成本
export function agentCostEdit(data) {
    return request({
        url: '/api/ag/agent/open/policy/edit/agent/cost',
        method: 'post',
        data
    })
}
// 修改代理商达标分账配置
export function standardShareEdit(data) {
    return request({
        url: '/api/ag/agent/open/policy/edit/standard/share/config',
        method: 'post',
        data
    })
}
// 修改代理商服务费分账配置
export function serviceFeeShareEdit(data) {
    return request({
        url: '/api/ag/agent/open/policy/edit/serviceFee/share/config',
        method: 'post',
        data
    })
}
// 修改代理商通讯费分账配置
export function commFeeShareEdit(data) {
    return request({
        url: '/api/ag/agent/open/policy/edit/commFee/share/config',
        method: 'post',
        data
    })
}
// 已开通列表
export function yetPolicyList(query) {
    return request({
        url: '/api/ag/agent/open/policy/info',
        method: 'get',
        params: query
    })
}

// 代理商自己开通的政策
export function myPolicyList(query) {
    return request({
        url: '/api/ag/my/center/open/policy/list',
        method: 'get',
        params: query
    })
}

// 修改代理商费率
export function agentFeeRangeEdit(data) {
    return request({
        url: '/api/ag/agent/open/policy/edit/agent/agentfeerange',
        method: 'post',
        data
    })
}